import request from '@/utils/request';

// 查询收货地址列表
export function listAddress(query) {
	return request({
		url: '/mall/address/list',
		method: 'post',
		data: query,
	});
}

// 查询收货地址详细
export function getAddress(id) {
	return request({
		url: '/mall/address/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增收货地址
export function addAddress(data) {
	return request({
		url: '/mall/address/add',
		method: 'post',
		data: data,
	});
}

// 编辑收货地址
export function updateAddress(data) {
	return request({
		url: '/mall/address/edit',
		method: 'post',
		data: data,
	});
}

// 删除收货地址
export function delAddress(id) {
	return request({
		url: '/mall/address/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出收货地址
export function exportAddress(data) {
	return request({
		url: '/mall/address/export',
		method: 'post',
		data: data,
	});
}
